// dlg.txt

begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(79,3) == 0 && gf(79,2) == 0;
	question = "special";
	text1 = "You enter the eastern gallery, the broad marble corridor that curves around the huge central dome. Rows of benches stretch off to the north and south.";
	text2 = "The wall is punctuated by a number of stone panels, which can be lowered so that spectators can see public events. This meeting of the Council, however, is very private. They are all closed.";
	text3 = "The doorways into the dome have been left open, so that you can enter. You can hear the distant echoes of shouting. The Council is currently having a passionate argument.";
	action = SET_SDF 79 3 1;

begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = get_sdf(79,3) == 0 && gf(79,2) == 1;
	question = "special";
	text1 = "You enter the eastern gallery, the broad marble corridor that curves around the huge central dome. Rows of benches stretch off to the north and south.";
	text2 = "The wall is punctuated by a number of stone panels, which can be lowered so that spectators can see public events. This meeting of the Council, however, is very private. They have all been left closed to help defend the dome.";
	text3 = "As you climbed the tunnel up to the dome, Akhari Blaze and his drakons caught up with and walked past you. Now that you are here, you can see that he is lurking just outside the dome. A large hole has been blasted into the wall.";
	text4 = "You hear roaring and fighting creations and smell blood and essence in the air. The drakons are making creations and sending them into the dome, to test the defenses of the Shapers beyond.";
	action = SET_SDF 79 3 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = get_sdf(79,5) == 0 && gf(79,2) == 1;
	question = "special";
	text1 = "At last, you enter the great Council Hall of the Shapers. Built a century after the foundation of the Shaper Empire, this enormous chamber has spent centuries as the heart of Shaper power. It is enormous.";
	text2 = "The floor is polished marble. Centuries of pacing sages, scholars, and serviles have worn long paths in the stone. The granite dome arches high overhead. Many generations of serviles have spent their lives climbing up there to remove bird nests.";
	text3 = "But that is nowhere near as terrifying as the Shapers in the center of the hall. Some are by the north and south walls. Some to the west. And the three surviving members of the Council stand in the center.";
	text4 = "They are Councilor Nawaz of Lethia Province, Councilor Sharissa of the Nodye Coast, and, in the center, High Councilor Shema, the aged leader of the Council.";
	text5 = "These are the leaders of the old, soft, wealthy provinces of the Shaper Empire. Untouched by war, the are stunned to find your surprise attack has placed a force of drakons at their gate.";
	text6 = "But they are Shapers still. They will not surrender. You can see that they would rather die than surrender the heart of their Empire to a creation rabble. It is a noble sentiment, but one that may be their undoing."; 
	action = SET_SDF 79 5 1;

begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = get_sdf(79,6) == 0 && gf(79,2) == 1;
	question = "special";
	text1 = "From here, you have a better view of the three Councilors. They and the drakons are testing each other, using their powers to create waves of creations and send them at their opponents.";
	text2 = "However, not surprisingly, the Councilors have help. Each is standing on a Shaping platform. Crystal conduits deliver power to the platforms, and this energy forms a shield that envelops and sustains the three Shapers.";
	text3 = "The conduits run to the west. You can see huge crystals, charged with power, by the far wall.";
	action = SET_SDF 79 6 1;

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Unfortunately, this is the worst possible place to be seen flaunting the rules of the Shapers. Your nature makes you very suspicious as it is.";
	text2 = "You rapidly find yourself deep in Shaper lands, hunted, and without friends. You are captured and dumped in a cell.";
	text3 = "You are freed eventually. By the time you emerge into the sunlight, however, your absence has enabled events to take a distinct turn for the worse. It is too late for you to turn things around ...";
	code =
		erase_char(1000);
	break;

begintalknode 10;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "At last, you enter the great Council Hall of the Shapers. Built a century after the foundation of the Shaper Empire, this enormous chamber has spent centuries as the heart of Shaper power. It is enormous.";
	text2 = "The floor is polished marble. Centuries of pacing sages, scholars, and serviles have worn long paths in the stone. The granite dome arches high overhead. Many generations of serviles have spent their lives climbing up there to remove bird nests.";
	text3 = "But there is something even more imposing here.";

begintalknode 11;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You force yourself to walk forward, step by step, a little bit at a time, concentrating on not being overawed by the settings. For this chamber is not the most intimidating thing before you. The entire Shaper Council is in session.";
	text2 = "All seven of them are there. The four from the central provinces, ravaged by war. Rawal. Astoria. Alwan. Taygen. They are exhausted and their faces are red, worn down by the argument about how their exhausted lands are to be saved.";
	text3 = "Two from the coastal provinces. Councilor Sharissa from the Nodye Coast and Councilor Nawaz from Lethia Province. Wealthy, soft, stylishly dressed, untouched by the struggle, unsure about how to proceed.";
	text4 = "And their leader, High Councilor Shema. He was once thought the most skilled and wisest of the Shapers, but he is old. His best years have passed him by, and he seems to be exhausted at the moment that requires his greatest strength.";

begintalknode 12;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You watch them, these titans of Terrestia, unsure how to proceed. It takes several minutes of them shouting before they notice you.";
	text2 = "Rawal is the first to see you. He stares at you intently for a moment and then smiles smugly. He knows that you still bear the control tool. One day, he plans to turn this to his advantage.";
	text3 = "Rawal is the first to see you. He stares at you intently for a moment. Then he looks concerned. He has tried to sense the control tool, but he can't. He looks furious.";
	text4 = "Then High Councilor Shema sees you. _Ah, yes. The mysterious wanderer,_ he says in a tired voice. _We are told that you can bring some illumination. Something has to. Please approach._";
	text5 = "Then High Councilor Shema sees you. _Ah, yes. The strange servile, the powerful rogue,_ he says in a tired voice. _We are told that you can bring some illumination. Implausible, but something has to. Please approach._";
	text6 = "As you step forward, you realize that someone is behind you. You look back. It is Litalia. Somehow, she has slipped in after you. You hope that she is convincing. The Shapers would like nothing more than to kill her.";
	code =
		if (gf(100,8) > 0)
			rs(2);
			else rs(3);
		if (gf(79,4) != 4)
			rs(6);
		if (creature_type(pc_num()) != 46) 
			rs(5);
			else rs(4);
	break;
	
begintalknode 13;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You try to speak with one of the Elite Guard of the Shaper Citadel. These amazingly disciplined warriors are renowned for their ability to silently stand at attention no matter what distractions they face.";
	text2 = "Sadly, their total immobility results in an entirely unhelpful conversation. You resist the urge to flick this soldier in the nose.";

begintalknode 14;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You try to speak with this drakon, but the mighty creature is exhausted. The exertion of this assault is taxing even the mighty strength of a drakon. You leave it to concentrate on its efforts.";

begintalknode 15;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You try to speak to the rotghroths, but they seem extremely agitated. You leave them alone for now. Maybe they will be calmer later.";

begintalknode 16;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Although massive blows are being directed at the Councilor, much of the force is being deflected by a faint, insubstantial shield. The barrier is projected by the platform under the Shaper's feet.";
	text2 = "You look for the source of the barrier. All you can see are conduits running away from the platform across the floor to the west.";

begintalknode 17;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "With a final scream, Councilor Sharissa of the Nodye Coast falls.";
	text2 = "The Nodye Coast is the oldest and wealthiest of the Shaper provinces. Rising up to lead there requires great wealth and political influence. Great skill as a Shaper doesn't generally enter into it.";
	text3 = "Today, this has been very much to your advantage.";

begintalknode 18;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "Councilor Nawaz, the leader of Lethia Province, fails to deflect an attack. It blasts him in the chest, flinging him off of his platform. Stunned into unconsciousness, he soon succumbs to his wounds.";
	text2 = "And, in an instant, another member of the Shaper Council falls.";

begintalknode 19;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "At last, the unthinkable happens. High Councilor Shema, figurehead of the Shaper Empire, dies. He is old and wise, but his skills have been allowed to atrophy. Before he has the chance to fully summon his power, a blow shatters his ribcage.";
	text2 = "He falls to his knees. With his last scraps of strength, he looks around the Citadel dome. His place of power. His home. The heart of his people, that he swore to protect. Failed to protect.";
	text3 = "In his last moments, the enormity of what has happened strikes him. He realizes what he has lost. And then he falls.";
	text4 = "With every moment, the Shaper Empire fades farther into history.";

	
//

begintalknode 30;
	state = -1;
	nextstate = 30;
	condition = 1;
	question = "Name";
	text1 = "As you approach Akhari Blaze, he puts the final touches on a cryodrayk. The newly made creature looks up at its creator blankly, still confused about what is going on. Akhari points west and says, _Attack._";
	text2 = "As the cryodrayk trustingly lumbers off, Akhari Blaze says, _We are here, but the defenses are stronger than expected. We can occupy the Councilors, for now._";
	text3 = "_But, before we can charge, we need to remove the defenses on their flanks._";
	text5 = "Akhari Blaze continues to make creations. The effort of the assault is actually starting to show. His movements are less sure and his creations seem more erratic, less skillfully made.";
	text6 = "_Report. If we do not strike soon, we may lose our chance._";
	action = INTRO;

begintalknode 31;
	state = 30;
	nextstate = 31;
	condition = 1;
	question = "What is the situation?";
	text1 = "_It is as predicted. Three members of the Council. Their defenders. Some support machinery. A difficult challenge, but what I expected is true._";

begintalknode 32;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "What did you expect?";
	text1 = "_These three have not fought for many years. They have not prepared. They were complacent. Now they are shaken. If we do not kill them now, they will go prepare. They will be far stronger next time._";

begintalknode 33;
	state = 31;
	nextstate = -1;
	condition = 1;
	question = "Support machinery?";
	text1 = "_The dome is not as well-defended as I thought it would be. I suppose they thought it would damage the aesthetics of the place._ He lets out a short, sulfurous chuckle.";
	text2 = "_But some machinery was put in place to defend and sustain them._";

begintalknode 34;
	state = 30;
	nextstate = 32;
	condition = gf(79,7) < 2;
	question = "What do I need to do?";
	text1 = "_We are occupying the members of the Council. However, they have support. Many of their Shapers went off to fight Ghaldring's diversionary force, but there are several more in there. By the north and south walls._";
	text2 = "_Get in there and kill them._";
	action = SET_SDF 79 7 1;
	
begintalknode 35;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "Location and numbers?";
	text1 = "_At least four, maybe more. Some by the north wall and some by the south._";

begintalknode 36;
	state = 32;
	nextstate = -1;
	condition = 1;
	question = "How will I get to them?";
	text1 = "_Enter the dome and move along the walls. The Councilors will not leave the safety of their shields, so you should be able to reach the others without much trouble._";

begintalknode 37;
	state = 32;
	nextstate = 33;
	condition = get_stat(20) >= 8;
	question = "Can I get some support?";
	text1 = "_Hmmm. When we first entered, the other drakons made two packs of rotghroths. They were meant to serve as shock troops. And then they lost control. Unforgivable carelessness at a time like this._";
	text2 = "_We sent them out of the way, where they wouldn't be trouble._";

begintalknode 38;
	state = 33;
	nextstate = -1;
	condition = gf(79,10) == 0 && gf(79,11) == 0;
	question = "Where are they?";
	text1 = "_In the galleries, one group to the north and one to the south. If you can manage to take control of them, you can use them to help you._";

begintalknode 39;
	state = 30;
	nextstate = -1;
	condition = gf(79,9) > 3 && gf(79,7) == 1;
	question = "The Shapers by the north and south walls are dead.";
	text1 = "Akhari Blaze nods. He definitely looks weaker. The other drakons are exhausted. You don't have much time left. _Then it is almossst ... We mussst strike sssoon._ The drakon's voice has regained its sibilance.";
	text2 = "_There isss a little more you can do to weaken them, but you mussst act fassst. Otherwissse, we ssstrike. Sssay ... Sssay when you are prepared to aid ... We may need your aid._";
	action = SET_SDF 79 7 2;
	
begintalknode 40;
	state = 30;
	nextstate = 34;
	condition = gf(79,7) == 2;
	question = "What else can I do?";
	text1 = "_Disssable ... Disssable the machinesss to the wessst. They defend the Shapersss. The Councilorsss may be very hard to kill with those machinesss intact._";

begintalknode 41;
	state = 34;
	nextstate = -1;
	condition = 1;
	question = "How can I disable them?";
	text1 = "_Smash them. Living toolsss. I do not know. Isss your tasssk. Even if you have no skillsss with machinesss, maybe you can still destroy one of them. Make thingsss much easier._";
	text2 = "_Maybe your pet rotghrothsss can help you._";
	code =
		if ((gf(79,10) < 2) && (gf(79,11) < 2))
			rs(2);
	break;
	
begintalknode 42;
	state = 34;
	nextstate = -1;
	condition = 1;
	question = "Can you hold out while I destroy the machines?";
	text1 = "_Yesss ... If you hurry. Isss worth the cost to break them._";

begintalknode 43;
	state = 30;
	nextstate = -1;
	condition = gf(79,7) == 2;
	question = "I will be back soon. Don't charge yet.";
	text1 = "Akhari Blaze nods and begins to Shape a new cryodrayk. It comes out twisted and lopsided. Even if it survived the battle, it wouldn't live much longer than that. You will have to act quickly.";
	action = END_TALK;
	
begintalknode 44;
	state = 30;
	nextstate = -1;
	condition = gf(79,7) == 2 && party_dist_to_nav(0) <= 5;
	question = "I am ready. Attack.";
	text1 = "_Hssss. Come closer to the dome. Then we attack._";
	action = END_TALK;
	
begintalknode 45;
	state = 30;
	nextstate = -1;
	condition = gf(79,7) == 2 && party_dist_to_nav(0) > 5;
	question = "I am ready. Attack.";
	text1 = "_Hssss. Yesss. It isss time. All these yearsss, I have dreamed of thisss. Thisss is how I want to die!_";
	text2 = "Akhari turns and mutters a spell. He directs a huge blast of fire at the ceiling of the gallery behind you, shattering the keystones of one of the arches. The ceiling collapses, blocking your escape path with rubble.";
	text3 = "_Come, drakons! Come, little one! Thisss isss the day the war isss won!_";
	text4 = "Akhari charges west through the gap, roaring as he goes.";
	action = END_TALK;
	code =
		sf(79,7,3);

		set_terrain(57,30,204 + get_ran(1,0,1));
		set_terrain(57,31,204);
		set_terrain(57,32,204 + get_ran(1,0,1));
		set_terrain(57,33,204);
		set_terrain(57,34,204 + get_ran(1,0,1));
		set_terrain(57,35,204 + get_ran(1,0,1));
		set_terrain(57,36,204 + get_ran(1,0,1));
		set_terrain(57,37,204);
		set_terrain(58,30,204 + get_ran(1,0,1));
		set_terrain(58,31,204);
		set_terrain(58,32,204);
		set_terrain(58,33,204 + get_ran(1,0,1));
		set_terrain(58,34,204 + get_ran(1,0,1));
		set_terrain(58,35,204 + get_ran(1,0,1));
		set_terrain(58,36,204 + get_ran(1,0,1));
		set_terrain(58,37,204 + get_ran(1,0,1));
		set_terrain(56,31,204);
		set_terrain(56,33,204 + get_ran(1,0,1));
		set_terrain(56,35,204 + get_ran(1,0,1));
		set_terrain(56,36,204 + get_ran(1,0,1));
	break;
	
begintalknode 46;
	state = 30;
	nextstate = -1;
	condition = gf(79,7) < 2;
	question = "There is something else I need to know.";
	text1 = "Akhari looks annoyed. _Now isss not time for talking. Thisss isss difficult. Time for fighting. Get ordersss and go fight!_";
	action = END_TALK;
	
	
//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = "There are several rotghroths back here. They look like they were recently (and sloppily) created. They are under nobody's control. They have not yet gone rogue, though the chaos and the smell of blood is making them unstable.";
	text2 = "One of them looks at you and lets out a long, forlorn gurgling noise. The creatures are very confused.";

begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = gf(79,gf(79,12)) == 0 && get_stat(20) < 10;
	question = "(Take control of them.)";
	text1 = "You close your eyes, extend your will, and try to calm these creatures. They flinch back and make angry, agitated noises. Your skill isn't quite enough to sedate them.";
	text2 = "You back away before your crude intervention makes things worse.";
	action = END_TALK;
	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = gf(79,gf(79,12)) == 0 && get_stat(20) >= 10;
	question = "(Take control of them.)";
	text1 = "You close your eyes, extend your will, and try to calm these creatures. They flinch back and make angry, agitated noises. You double your efforts, soothing the panicked beasts. You also try to ignore their foul odor.";
	text2 = "Soon, you have some success. They are not fully under your control, but you might be able to get them to follow an order or two.";
	code =
		sf(79,gf(79,12),1);
	break;
	
begintalknode 53;
	state = 50;
	nextstate = -1;
	condition = gf(79,gf(79,12)) > 0;
	question = "Wait here. I need to check my orders.";
	text1 = "The rotghroths look at you trustingly, happy that someone is looking out for them.";
	action = END_TALK;
	
begintalknode 54;
	state = 50;
	nextstate = -1;
	condition = gf(79,gf(79,12)) > 0 && gf(79,7) > 0 && gf(79,9) < 4;
	question = "I need you to kill a pair of Shapers, by the wall of the dome. Go now.";
	text1 = "You give the directions to the rotghroths, supplementing them as necessary with mental images. Once they seem to understand, you send them off to attack.";
	text2 = "Of course, without support, it is unlikely that they will achieve anything but a swift death.";
	action = END_TALK;
	code =
		sf(79,gf(79,12),2);
	break;
	
begintalknode 55;
	state = 50;
	nextstate = -1;
	condition = gf(79,gf(79,12)) > 0 && gf(79,7) > 0 && gf(79,9) >= 4;
	question = "I need you to advance into the dome. Gather at the side wall.";
	text1 = "You give the directions to the rotghroths, supplementing them as necessary with mental images. Once they seem to understand, you send them off to help secure the territory you have claimed.";
	action = END_TALK;
	code =
		sf(79,gf(79,12),2);
	break;
	
begintalknode 56;
	state = 50;
	nextstate = -1;
	condition = gf(79,gf(79,12)) == 0;
	question = "(Move away.)";
	text1 = "You back away before you do anything to accidentally aggravate them.";
	action = END_TALK;

/// 

begintalknode 60;
	state = -1;
	nextstate = 60;
	condition = 1;
	question = "";
	text1 = "This rotghroth is wandering nervously by the wall of the dome, unsure of what to do. It looks to you for guidance.";

begintalknode 61;
	state = 60;
	nextstate = -1;
	condition = gf(79,gf(79,12)) == 2 && get_stat(20) < 12;
	question = "Continue the advance. Keep moving around the dome.";
	text1 = "You try to command the rotghroth, but its close proximity to the Shapers is making it extremely nervous. It wanders around, paralyzed with fear. This seems to be as far as you can command it to go.";
	action = END_TALK;

begintalknode 62;
	state = 60;
	nextstate = -1;
	condition = gf(79,gf(79,12)) == 2 && get_stat(20) >= 12;
	question = "Continue the advance. Keep moving around the dome.";
	text1 = "You try to command the rotghroth, but its close proximity to the Shapers is making it extremely nervous. It takes a powerful exertion of will to shift it, but you are up to the task.";
	text2 = "The rotghroth begins to walk slowly toward the west wall.";
	action = END_TALK;
	code =
		sf(79,gf(79,12),4);
	break;

begintalknode 63;
	state = 60;
	nextstate = -1;
	condition = 1;
	question = "Just stay here.";
	text1 = "The rotghroth continues to shuffle around aimlessly.";
	action = END_TALK;

//

begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = "You examine this device. It sits on top of the conduits, controlling the flow of energy that travels from the crystals to the west to the Shapers in the center.";
	text2 = "The power flow is currently cut off.";
	text3 = "The device is fairly simple and is mainly designed to keep too much energy from passing through it. Sending a deadly jolt of power through is not an option.";
	text4 = "However, with skill and the correct equipment, you might be able to cut the power off.";
	code =
		if (gf(79,gf(79,29)) > 0) {
			rs(3); rs(4);
			}
			else rs(2);
	break;
	
begintalknode 71;
	state = 70;
	nextstate = -1;
	condition = gf(79,gf(79,29)) == 0 && num_of_item(255) < 3;
	question = "Cut off the power. (Use 3 living tools.)";
	text1 = "You don't have enough tools.";
	action = END_TALK;
	
begintalknode 72;
	state = 70;
	nextstate = -1;
	condition = gf(79,gf(79,29)) == 0 && num_of_item(255) >= 3 && get_stat(21) < gf(79,24);
	question = "Cut off the power. (Use 3 living tools.)";
	text1 = "You start to use your tools, only to find that this device is far more complicated than it appeared. Or, at least, its safeguards are.";
	text2 = "If you had a few uninterrupted hours, you might be able to figure out how it works. As it is, however, you are forced to leave it alone.";
	action = END_TALK;

begintalknode 73;
	state = 70;
	nextstate = -1;
	condition = gf(79,gf(79,29)) == 0 && num_of_item(255) >= 3 && get_stat(21) >= gf(79,24);
	question = "Cut off the power. (Use 3 living tools.)";
	text1 = "You start to use your tools, only to find that this device is far more complicated than it appeared. Or, at least, its safeguards are. Fortunately, the brave sacrifice of your living tools enables you to pass its defenses.";
	text2 = "After that, it is a simple matter to disconnect a small conduit and crack a focusing crystal. The flow of power to the platform in the center of the dome is cut off.";
	action = END_TALK;
	code =
		take_num_of_item(255,3);
		sf(79,gf(79,29),1);
	break;

begintalknode 74;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "Leave the device alone.";
	text1 = "You back away. There are plenty of other things to worry about here.";
	action = END_TALK;

//

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode 91;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "";
	text1 = ".";
	text2 = "";
		